package dobest.ray.com.jiongjiong.activity.HomePage;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import dobest.ray.com.jiongjiong.R;
import dobest.ray.com.jiongjiong.activity.BaseFragment;
import dobest.ray.com.jiongjiong.activity.HomePage.statue.EyeDiseaseInvestigationActivity;
import dobest.ray.com.jiongjiong.activity.HomePage.statue.FarVisonActivity;
import dobest.ray.com.jiongjiong.activity.HomePage.statue.emr.ElectronicMedicalRecordActivity;
import dobest.ray.com.jiongjiong.activity.HomePage.trend.ProfessionalInterventionActivity;
import dobest.ray.com.jiongjiong.activity.HomePage.trend.VisualFunctionAcitivity;

/**
 * Created by Ray on 2016/3/16.
 * https://github.com/ray0807
 */
public class VisionStatueFragment extends BaseFragment implements View.OnClickListener {
    private LinearLayout ll_eye_disease_investigation;
    private LinearLayout ll_eye_vision_funtion;
    private LinearLayout ll_electronic_medical_record;
    private LinearLayout ll_far_vision;
    private RelativeLayout rl_q;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_vision_status, container, false);
    }

    @Override
    protected void findViews(View view) {
        ll_eye_disease_investigation = (LinearLayout) view.findViewById(R.id.ll_eye_disease_investigation);
        ll_eye_vision_funtion = (LinearLayout) view.findViewById(R.id.ll_eye_vision_funtion);
        ll_electronic_medical_record = (LinearLayout) view.findViewById(R.id.ll_electronic_medical_record);
        ll_far_vision = (LinearLayout) view.findViewById(R.id.ll_far_vision);
        rl_q = (RelativeLayout) view.findViewById(R.id.rl_q);
    }

    @Override
    protected void init() {

    }

    @Override
    protected void addListeners() {
        ll_eye_disease_investigation.setOnClickListener(this);
        ll_eye_vision_funtion.setOnClickListener(this);
        ll_electronic_medical_record.setOnClickListener(this);
        ll_far_vision.setOnClickListener(this);
        rl_q.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent it = null;
        switch (v.getId()) {
            case R.id.ll_eye_disease_investigation:
                it = new Intent(mActivity, EyeDiseaseInvestigationActivity.class);
                break;
            case R.id.ll_eye_vision_funtion:
                it = new Intent(mActivity, VisualFunctionAcitivity.class);
                break;
            case R.id.rl_q:
                it = new Intent(mActivity, ProfessionalInterventionActivity.class);
                break;
            case R.id.ll_electronic_medical_record:
                it = new Intent(mActivity, ElectronicMedicalRecordActivity.class);
                break;
            case R.id.ll_far_vision:
                it = new Intent(mActivity, FarVisonActivity.class);
                break;
        }
        if (it != null) {
            mActivity.startActivity(it);
        }
    }
}
